// components/c-lifetime/c-lifetime.js
Component({
  lifetimes: {
    created() {
      console.log("组件被创建created");
    },
    attached() {
      console.log("组件被添加到组件树中attached");
    },
    ready() {
      console.log("在渲染线程被初始化已经完成ready");
    },
    moved() {
      console.log("在组件实例被移动到节点树另一个位置时执行moved");
    },
    detached() {
      console.log("组件从组件树中被移除 detached");
    }
  },
  pageLifetimes: {
    show() {
      console.log("Component 组件所在的页面被展示时执行 show");
    },
    hide() {
      console.log("Component 组件所在的页面被隐藏时执行 hide");
    },
    resize: function(size) {
      console.log("Component 组件所在的页面尺寸变化时执行 hide");
    }
  }
})